{% extends "../theme/base_edit.html" %}


{% block edit %}

<div class="panel panel-black">

    <div class="panel-heading">添加</div>

    <div class="panel-body">

        <form  method="post" class="form-horizontal" id="form_add">
            <input type="hidden" id="uid" name="uid" value="{{ kwd['uid'] }}">


            <div class="form-group">
                <label class="col-sm-2 control-label">标题</label>

                <div class="col-sm-10">
                    <input class="form-control" id="title" type="text" name="title">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label" for="tags">标签</label>

                <div class="col-sm-10">
                    <input class="form-control" id="tags" name="tags" type="text" value="">
                </div>
            </div>

            {% for ii in range(0,5) %}
            <div class="form-group">
                {% if ii == 0 %}
                <label for="pcat0" class="col-sm-2 control-label">分类</label>
                {% else %}
                <label for="pcatx" class="col-sm-2 control-label"></label>
                {% end %}
                <div class="col-sm-3">
                    <select name="pcat{{ii}}" id="pcat{{ii}}" class="form-control"
                            onchange="g_load_postcat({{ii}})">
                        <option value="">请选择</option>
                        {% for taginfo in tag_infos %}
                        {% if taginfo.uid.endswith('00') %}
                        <option value="{{ taginfo.uid }}">{{ taginfo.name }}
                        </option>
                        {% else %}
                        {% end %}
                        {% end %}
                    </select>
                </div>
                <div class="col-sm-4">
                    <select name="gcat{{ii}}" id="gcat{{ii}}" class="form-control">

                    </select>
                </div>
            </div>
            {% end %}


            <div class="form-group">
                <label class="col-sm-2 control-label" for="logo">图片</label>

                <div class="col-sm-10">

                    <input type="text" id="logo" name="logo" class="form-control" readonly/>

                    <br>

                    <a class="btn btn-primary btn-sm" data-toggle="modal" data-target="#myModal">
                        上传图片
                    </a>

                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label" for="cnt_md">内容</label>

                <div class="col-sm-10">
                    <textarea class="form-control" rows=26 id="cnt_md" name="cnt_md" cols="100"></textarea>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label" for="sub1"></label>

                <div class="col-sm-10">
                    <input id="sub1" type="submit" value="添加数据" class="btn btn-primary">
                </div>
            </div>

        </form>
        {% module upload_pic() %}

    </div>
</div>
{% end %}
